#include <iostream>
#include <string>

/*
定义一个圆类(Circle):成员-->半径(radius)面积(area)及相关函数

定义一个桌子类(Desk):成员-->高度(high)材质(texture)及相关函数

由这两个类共同派生出圆桌类(Circle_dest):

新增成员颜色(color) 及相关函数

实例化一个圆桌类 输出相关对象
*/

using namespace std;

#define PI 3.1415926

class Cricle
{
public:
    double radius;
public:
    Cricle(double radius) : radius(radius) {}
    double getArea() const
    {
        return PI * radius * radius;
    }
};

class Desk
{
public:
    double high;
    string texture;//材质
public:
    Desk(double high, string texture) : high(high), texture(texture) {};
    void show() const
    {
        cout << "桌子高度: " << high << " 材质: " << texture << endl;
    }
};

class Cricle_desk : public Cricle, public Desk
{
public:
    string color;// 颜色
public:
    Cricle_desk(double radius, double high, string texture, string color) : Cricle(radius), Desk(high, texture), color(color) {}
    void show() const
    {
        cout << "半径: " << Cricle::radius << " 面积: " << Cricle::getArea() << endl;
        Desk::show();
        cout << "颜色: " << color << endl;
    }
};

int main(int argc, char const *argv[])
{
    Cricle_desk desk(1.0, 0.8, "wood", "red");
    desk.show();
    
    return 0;
}
